//
//  SettingWebviewController.m
//  Stock
//
//  Created by blacksun on 11-7-9.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "SettingWebviewController.h"


@implementation SettingWebviewController
@synthesize webView;
@synthesize requestUrl;
@synthesize activeView;
@synthesize htmlString;


- (void)dealloc
{
    [webView stopLoading];
    [webView release];
    [requestUrl release];
    [activeView release];
    self.htmlString = nil;
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    [webView stopLoading];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark -WebView delegate
- (void)webViewDidStartLoad:(UIWebView *)webView{
    
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    [self.activeView stopAnimating];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
     [self.activeView stopAnimating];   
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    /*NSURL *url = [[NSURL alloc] initWithString:self.requestUrl];
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
    [webView loadRequest:request];
    [request release];
    [url release];*/
    [self.webView loadHTMLString:htmlString baseURL:nil];
    
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    [webView stopLoading];
    [webView release];
    [activeView release];
    
}
@end
